package tarena.netctoss.service.impl;

import java.util.List;
import tarena.netctoss.dao.Pagination;
import tarena.netctoss.dao.PricingCondition;
import tarena.netctoss.dao.PricingDao;
import tarena.netctoss.po.Pricing;
import tarena.netctoss.service.PricingService;

/**
 * 资费业务层
 * 
 * @author Wangpeihu
 * @team [Never give up]
 * @since JDK1.6(建议)
 * @date 2010-3-2
 */
public class PricingServiceImpl implements PricingService {
	private PricingDao pricingDao;

	/**
	 * 依赖注入
	 * 
	 * @param pricingDao
	 */
	public void setPricingDao(PricingDao pricingDao) {
		this.pricingDao = pricingDao;
	}

	/**
	 * 删除
	 */
	public void delete(Pricing pricing) {
		pricingDao.delete(pricing);
	}

	/**
	 * 查找所有
	 */
	public List<Pricing> findAll(Pagination page, PricingCondition pc) {
		pricingDao.loadMaxPage(page, pc); // 加载最大页页号
		return pricingDao.findAll(page, pc);
	}

	public Pricing findById(Integer id) {
		return pricingDao.findById(id);
	}

	public void save(Pricing pricing) {
		pricingDao.save(pricing);
	}

	public void update(Pricing pricing) {
		pricingDao.update(pricing);
	}

	public List<Pricing> findAll() {
		return pricingDao.findAll();
	}

}
